package com.ap.core.business.message.validation.info.impl;

import org.joda.time.LocalDateTime;

import com.ap.core.common.types.MessageStatus;
import com.ap.core.cxf.jaxb.common.DeliveryType;
import com.ap.core.cxf.jaxb.rtp.TransactionCheckOutType;
import com.ap.core.domain.Amount;
import com.ap.core.domain.OrderPayment;
import com.ap.core.validation.message.info.RTPOriginalInfoForConfirmPayment;

/**
 * User: Ranjit.Singh
 */
public class RTPOriginalInfoForConfirmPaymentImpl implements RTPOriginalInfoForConfirmPayment {

    private final OrderPayment orderPayment;
    
    private final Long apMessageId;

    public RTPOriginalInfoForConfirmPaymentImpl(OrderPayment orderPayment, Long apMessageId) {
        this.orderPayment= orderPayment;
        this.apMessageId = apMessageId;
    }

    @Override
    public OrderPayment getOriginalOrderPayment() {
        return orderPayment;
    }

    @Override
    public TransactionCheckOutType getTransactionCheckOutType() {
        return null == orderPayment ? null :orderPayment.getTransactionCheckoutType();
    }

    @Override
    public DeliveryType getDeliveryType() {
        return null == orderPayment ? null : orderPayment.getDeliveryType();
    }

	@Override
	public Long getFIid() {
		  return null == orderPayment ? null : orderPayment.getFIId();
	}


	@Override
	public Amount getTotalPaymentRequestAmount() {
		  return null == orderPayment ? null : orderPayment.getTotalPaymentRequestAmount();
	}


	@Override
	public String getApTransactionId() {
		 return null == orderPayment ? null : orderPayment.getApTransactionId();
	}


	@Override
	public Long getApTransactionRetrievalId() {
		 return null == orderPayment ? null : orderPayment.getApTransactionRetrievalId();
	}


	@Override
    public boolean isOrderPaymentExists(MessageStatus msgStatus) {
        return null != orderPayment && msgStatus == orderPayment.getStatusCode();
    }


	
	@Override
	public LocalDateTime getConfirmationExpiryTimeStmp() {
		return null == orderPayment ? null :orderPayment.getConfirmationExpiryTimeStmp();
	}
	
	@Override
	public LocalDateTime  getReconCutoffEndTimeStmp() {
		 return null == orderPayment ? null :orderPayment.getReconCutoffEndTimeStmp();
	}


	@Override
	public Long getApMessageId() {
		return this.apMessageId;
	}

    @Override
    public LocalDateTime getConfirmationTimeStmp() {
        return null == orderPayment ? null :orderPayment.getConfirmationTimeStmp();
    }


}
